package org.apache.spark.sql

import Thread.sleep

object BasicApp {
    def main(args: Array[String]): Unit = {

        val spark: SparkSession = SparkSession.builder()
          .appName("Spark SQL basic example")
          .master("local")
          //.config("spark.some.config.option", "some-value")
          .getOrCreate()

        val dataFrame: DataFrame = spark.read.json("/Users/andy/Documents/bigdata/bigdata-study/data/student.json")
        //dataFrame.show()
        import spark.implicits._
        dataFrame.select("age").filter($"age" > 20).show()

        //sleep(Int.MaxValue)

        spark.stop()
    }
}
